//
//  ViewController.m
//  LSDrawerExample
//
//  Created by LuckyStrike on 2018/3/23.
//  Copyright © 2018年 LuckyStrike. All rights reserved.
//

#import "ViewController.h"
#import "FirstViewController.h"
#import "SecondViewController.h"
#import "ThirdViewController.h"
#import "DrawerViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    
    // Do any additional setup after loading the view, typically from a nib.
    
    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/**
 
 #pragma mark -- 父子视图 helpers
 - (void)addChildViewController:(UIViewController *)childVC superView:(UIView*)superView frame:(CGRect)rect {
 //1.添加父子关系
 [self addChildViewController:childVC];
 //2.添加视图层级结构
 [superView addSubview:childVC.view];
 //3.设置位置和约束
 childVC.view.frame = rect;
 childVC.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
 
 [childVC beginAppearanceTransition:YES animated:NO];
 [childVC endAppearanceTransition];
 //4.通知添加完毕
 [childVC didMoveToParentViewController:self];
 }
 - (void)removeChildViewController:(UIViewController*)childVC {
 //1.移除父子关系
 [childVC willMoveToParentViewController:nil];
 //2.移除约束
 [childVC beginAppearanceTransition:YES animated:NO];
 //3.移除视图层级结构
 [childVC.view removeFromSuperview];
 [childVC endAppearanceTransition];
 //4.通知移除完毕
 [childVC removeFromParentViewController];
 }
 
 */

@end
